<tpl var layoutBody={ />
<div data-identity="sys:resource" data-table="sys_resource">
	<div class="layui-breadcrumb">
		<a href="/manage/index.jspx">首页</a>
		<a href="/manage/sys/resource/index.jspx">资源管理</a>
		<a href="javascript:;">
			<cite>修改</cite>
		</a>
	</div>
	<hr>
	<fieldset class="layui-elem-field">
		<legend>修改 资源管理</legend>
		<div class="layui-field-box">
			<form class="layui-form" action="save.json?oper=update" lay-filter="mSysResourceForm">
				<div class="layui-form-item" data-type="int" data-isnull="NO" data-name="id">
					<label class="layui-form-label">资源ID：</label>
					<div class="layui-input-block">
						<input type="text" name="id" placeholder="请输入资源ID" autocomplete="off" class="layui-input" value="${record.id!}" readonly>
					</div>
				</div>
				<div class="layui-form-item" data-type="int" data-isnull="NO" data-name="pid">
					<label class="layui-form-label">上级资源：</label>
					<div class="layui-input-block">
						<select name="pid" class="layui-input">
							<option value="0" ${selected(record.pid!,0)}>__顶级资源__</option>
							<tpl for(item in rootList){ />
							<option value="${item.id!}" ${selected(record.pid!,item.id!)}>${item.name!}</option>
							<tpl } />
						</select>
					</div>
				</div>
				<div class="layui-form-item" data-type="varchar" data-isnull="NO" data-name="name">
					<label class="layui-form-label">资源名称：</label>
					<div class="layui-input-block">
						<input type="text" name="name" placeholder="请输入资源名称" autocomplete="off" class="layui-input" value="${record.name!}">
					</div>
				</div>
				<div class="layui-form-item" data-type="varchar" data-isnull="YES" data-name="icon">
					<label class="layui-form-label">资源图标：</label>
					<div class="layui-input-block">
						<input type="text" name="icon" placeholder="请输入图标" autocomplete="off" class="layui-input" value="${record.icon!}">
					</div>
				</div>
				<div class="layui-form-item" data-type="varchar" data-isnull="YES" data-name="icon">
					<label class="layui-form-label">连接地址：</label>
					<div class="layui-input-block">
						<input type="text" name="linkurl" placeholder="请输入连接地址" autocomplete="off" class="layui-input" value="${record.linkurl!}">
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<a class="layui-btn layui-btn-primary" href="javascript:history.go(-1)">返回</a>
						<button class="layui-btn" lay-submit lay-filter="mSysResourceForm">立即提交</button>
					</div>
				</div>
			</form>
		</div>
	</fieldset>
</div>
<tpl }; />

<tpl var layoutScript={ />
<script type="text/javascript">
	layui.config({
		base: '${webCdn}/plugins/layui/modules/'
	}).extend({
		http: 'http/http.min',
		message: 'message/message.min'
	}).use(['element', 'message', 'http', 'form'], function () {
		// 绑定表单提交事件
		layui.form.on('submit(mSysResourceForm)', function (data) {
			layui.http.post('save.json?oper=update', data.field, function (res) {
				layui.message.success(res.message, () => history.back());
			});

			return false;
		});
	});
</script>
<tpl }; />
<tpl include( "../../tpl/layout-scroll.html" ,{identity: "sys:resource" ,layoutBody:layoutBody,layoutScript:layoutScript}){} />